package 字节流缓冲流;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * 两个缓冲流：BufferedInputStream和BufferdOutputStream
 * 在src文件中缓存复制输出到des上
 * @author Administrator
 *
 */
public class Example07 {
	  public static void main(String[] args) throws IOException {
		  //创建一个带缓冲区的输入流
		  BufferedInputStream bis=new BufferedInputStream(new FileInputStream("src.txt"));
		  //创建一个带缓冲区的输出流
		  BufferedOutputStream bos=new BufferedOutputStream(new FileOutputStream("des.txt"));
		  int len;
		  while((len=bis.read())!=-1){
			  bos.write(len);
		  }
		  bis.close();
		  bos.close();
	}
}
